<?php
	if($_GET['page'] == "login.html")
		setCookie("loggedIn","false",(time()+(60*60*24)));
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>
  <head>
    <link href="css/style.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="bin/prototype.js"></script>
    <script type="text/javascript" src="bin/functions.js"></script>
    <script type="text/javascript" src="bin/library.js"></script>


    <title> LYON UNO </title>
  </head>

  <body>

    <div id="head_pic">
      <img src="images/title.png" alt="[LYON UNO]" id="picture">
    </div>

    <div id="webpage">
<form method="POST" action="/subscribe.php" onsubmit="return validate_reg(this)" name="formul_register">
<hr>
<table>
<tr>
	<td>	Desired Login Name	</td>
	<td>	<input type="text" maxlength="50" size="20" name="userR" />
		<span id="errorUser"></span>	</td>
</tr>
<tr>
	<td>	Choose a password	</td>
	<td>	<input type="password" name="passwordR">
		<span id="errorPassword"></span>	</td>
</tr>
<tr>
	<td>	Re-enter password	</td>
	<td>	<input type="password" name="password2R">	</td>
</tr>
<tr>
	<td>	Name	</td>
	<td>	<input type="text" maxlength="50" size="20" name="nameR" />
		<span id="errorName"></span>	</td>
</tr>
<tr>
	<td>	Birhtday (DD/MM/YYYY)	</td>
	<td>	<input type="text" maxlength="2" size="2" name="dayR" />
		<input type="text" maxlength="2" size="2" name="monthR" />
		<input type="text" maxlength="4" size="4" name="yearR" />
		<span id="errorDate"></span>	</td>
</tr>
<tr>
	<td>	E-mail	</td>
	<td>	<input type="text" maxlength="50" size="20" name="emailR" />
		<span id="errorEmail"></span>	</td>
</tr>
<?php
$hostDB = "localhost";
$userDB = "ampersand";
$passDB = "palomitas";
$dbnameDB = "LYONUNO";

$canalDB = mysql_connect($hostDB, $userDB, $passDB);
$db = mysql_select_db($dbnameDB);
$user = $_COOKIE["loggedIn"];
$consulta = 'select name,code from COUNTRIES order by name asc';

$resDB = mysql_db_query($dbnameDB, $consulta,$canalDB);

echo "<tr> <td> Country </td>\n";
echo "<td> <select name=\"countryR\">\n";
while($row = mysql_fetch_object($resDB)){
	$name = $row->name;
	$code = $row->code;
	echo "<option VALUE=\"$code\">$name</OPTION>\n";
}
echo "</select></td></tr>\n";
?>

<tr>
	<td>	Webpage	</td>
	<td>	<input type="text" maxlength="50" size="20" name="webpR" />	</td>
</tr>
<tr>
	<td>	Picture URL	</td>
	<td>	<input type="text" maxlength="200" size="20" name="picR" />	</td>
</tr>
</table>
<hr>
<input type="submit" name="send" value="I accept"/>
<input type="reset" name="clear" value="Clear data"/>
</form>
<hr>
<p> Click on 'I accept' if you agree to the 
<a href="main.php?page=conditions.html"  target="_blank"> Terms of Service </a>
and the
<a href="main.php?page=privacy.html"  target="_blank"> Privacy Policy </a>
<br>
<a href="main.php?page=login.html"> Back to login page</a>
</p>
    </div>

    <div id="foot">
      <address>LYON UNO. CPE <br> 43, boulevard du 11 Novembre 1918. BP 2077 <br> 69616 Villeurbanne Cedex </address>
    </div>
  </body>
</html>
